package com.jk.controller;

import com.jk.pojo.*;
import com.jk.service.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author jisiqi
 * @version 1.0
 * @description: TODO    系统设置Controller层
 * @date 2022/10/19 9:48
 */
@RestController
@RequestMapping("install")
public class SystemController {

    @Autowired
    private  SystemService systemService;

    /**
     * @description:  标签管理表查询
     * @param: labelEntity
     * @return: java.util.Map
     * @author 纪思齐
     * @date: 2022/10/19 9:56
     */
    @RequestMapping("getLabelList")
    public Map  getLabelList(LabelEntity labelEntity){
        return systemService.getLabelList(labelEntity);
    }

    /**
     * @description:  根据标签id修改状态
     * @param: id, state
     * @return: boolean
     * @author 纪思齐
     * @date: 2022/10/19 11:26
     */
    @RequestMapping("updateState")
    public boolean updateState(Integer id,Integer state){
        return  systemService.updateState(id,state);
    }

    /*
     * @description:  根据id删除
     * @author: 纪思齐
     * @date: 2022/10/19 14:24
     * @param: [id]
     * @return: boolean
     **/
    @RequestMapping("deleteLabelId")
    public  boolean  deleteLabelId(Integer id){
        return  systemService.deleteLabelId(id);
    }

    /*
     * @description:  查询资讯表
     * @author: 纪思齐
     * @date: 2022/10/19 16:16
     * @param: [informationEntity]
     * @return: java.util.Map
     **/
    @RequestMapping("getInformationList")
    public  Map  getInformationList(InformationEntity informationEntity){
        return systemService.getInformationList(informationEntity);
    }

    /*
     * @description:  查询轮播图表
     * @author: 纪思齐
     * @date: 2022/10/19 17:06
     * @param: [carouselEntity]
     * @return: java.util.Map
     **/
    @RequestMapping("getCarouselList")
    public  Map  getCarouselList(CarouselEntity carouselEntity){
        return  systemService.getCarouselList(carouselEntity);
    }

    /*
     * @description:  查询系统公告表
     * @author: 纪思齐
     * @date: 2022/10/19 17:47
     * @param: [systemEntity]
     * @return: java.util.Map
     **/
    @RequestMapping("getSystemList")
    public  Map  getSystemList(ProclamationEntity proclamationEntity){
        return  systemService.getSystemList(proclamationEntity);
    }

    /*
     * @description:  查询操作日志表
     * @author: 纪思齐
     * @date: 2022/10/19 19:17
     * @param: [logEntity]
     * @return: java.util.Map
     **/
    @RequestMapping("getLogList")
    public  Map  getLogList(LogEntity logEntity){
        return  systemService.getLogList(logEntity);
    }

    /*
     * @description:  根据资讯id删除
     * @author: 纪思齐
     * @date: 2022/10/19 19:25
     * @param: [id]
     * @return: boolean
     **/
    @RequestMapping("deleteInformationId")
    public  boolean deleteInformationId(Integer id){
        return  systemService.deleteInformationId(id);
    }

    /*
     * @description:  根据轮播图id删除
     * @author: 纪思齐
     * @date: 2022/10/19 19:28
     * @param: [id]
     * @return: boolean
     **/
    @RequestMapping("deleteCarouselId")
    public  boolean deleteCarouselId(Integer id){
        return  systemService.deleteCarouselId(id);
    }

    /*
     * @description:  根据系统公告id删除
     * @author: 纪思齐
     * @date: 2022/10/19 19:30
     * @param: [id]
     * @return: boolean
     **/
    @RequestMapping("deleteSystemId")
    public  boolean deleteSystemId(Integer id){
        return  systemService.deleteSystemId(id);
    }

    /*
     * @description:  查询角色管理表
     * @author: 纪思齐
     * @date: 2022/10/20 20:58
     * @param: []
     * @return: java.util.Map
     **/
    @RequestMapping("getRoleList")
    public  Map getRoleList(){
        return systemService.getRoleList();
    }

    /*
     * @description:  根据id删除角色
     * @author: 纪思齐
     * @date: 2022/10/20 21:38
     * @param: [id]
     * @return: boolean
     **/
    @RequestMapping("deleteRoleId")
    public boolean deleteRoleId(Integer id){
        return systemService.deleteRoleId(id);
    }

    /*
     * @description:  新增角色
     * @author: 纪思齐
     * @date: 2022/10/20 21:42
     * @param: [roleEntity]
     * @return: java.util.Map
     **/
    @RequestMapping("addRole")
    public  Map  addRole(RoleEntity roleEntity){
        return systemService.addRole(roleEntity);
    }

    /**
    * @Author: binzi
    * @Description:新增公告
    * @Date: 2022/10/24 10:19
    * @Return: java.util.Map
    **/
    @RequestMapping("addInform")
    public  Map  addInform(ProclamationEntity proclamationEntity){
        return systemService.addInform(proclamationEntity);
    }




}
